﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Imports Utilerias
Imports MySql.Data.MySqlClient
Public Class DiasCreditoFact
    Public Shared Function Build(ByVal dr As MySqlDataReader) As DiasCreditoBE
        Dim tmpDiasCredito As DiasCreditoBE = New DiasCreditoBE()
        Try
            With tmpDiasCredito
                .IdDiasCredito = convertDTFromDb.convertInt32(dr.Item("IdDiasCredito"))
                .NumDias = convertDTFromDb.convertInt16(dr.Item("NumDias"))
                .Descripcion = convertDTFromDb.ConvertString(dr.Item("Descripcion"))
                Select Case convertDTFromDb.ConvertString(dr.Item("Status"))
                    Case "A"
                        .Status = DiasCreditoBE.StatusDiasCredito.Activo
                    Case "I"
                        .Status = DiasCreditoBE.StatusDiasCredito.Inactivo
                    Case Else
                        .Status = DiasCreditoBE.StatusDiasCredito.Inactivo
                End Select
            End With
            Return tmpDiasCredito
        Catch ex As Exception
            Throw
        Finally
            tmpDiasCredito = Nothing
        End Try
    End Function
End Class
